#ifndef __TAXNOOMY_HANDLER_H__
#define __TAXNOOMY_HANDLER_H__
#include<xercesc/sax2/DefaultHandler.hpp>
#include"../Util/CharUtil.h"
#include"../ServiceConception.h"
#include<string>
#include<map>
#include<iostream>
#include<vector>
using namespace std;
using namespace xercesc;

typedef const XMLCh* const XercesString;

class TaxonomyHandler :
	public DefaultHandler
{
private:
	ServiceConception* m_pCurrentConception;
	map<string,ServiceConception*> m_mConceptions;
	map<string,string> m_mConInst;
	string m_sLast;
protected:
	void saveInstConRelation(FILE* fp);
	void saveConSubRelation(FILE* fp);
public:
	TaxonomyHandler(void);
	~TaxonomyHandler(void);
	virtual void startDocument();
	virtual void endDocument();
    
	virtual void startElement(
		const XMLCh* const uri, 
		const XMLCh* const localname, 
		const XMLCh* const qname, 
		const Attributes& attrs);
    
	virtual void endElement(
		const XMLCh* const uri, 
		const XMLCh* const localname,
		const XMLCh* const qname);

	vector<string> GetConceptions(const string concept);

	vector<string> GetConceptionsFromInstance(const string instance);

	void SaveAsMyFormat(const char* inst_con,const char* con_sub);

	/*virtual void characters(
		const XMLCh* const chars,
		XMLSize_t length);*/
};
#endif

